<#assign security=JspTaglibs["http://www.springframework.org/security/tags"] />
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>主页</title>
    <link rel="stylesheet" href="/layui/css/layui.css">
    <link rel="stylesheet" href="/css/iconfont.css">
    <link rel="stylesheet" href="/css/dtree.css">
    <link rel="stylesheet" href="/css/dtreefont.css">
    <script src="/layui/layui.js"></script>
    <script src="/init.js"></script>
</head>
<body class="layui-layout-body">
<div class="layui-layout layui-layout-admin">
    <div class="layui-header">
        <div class="layui-logo">中介管理系统</div>
        <!-- 头部区域（可配合layui已有的水平导航） -->
        <ul class="layui-nav layui-layout-left">
            <li class="layui-nav-item"><a href="">控制台</a></li>
            <li class="layui-nav-item"><a href="">商品管理</a></li>
            <li class="layui-nav-item"><a href="">用户</a></li>
            <li class="layui-nav-item">
                <a href="javascript:;">其它系统</a>
                <dl class="layui-nav-child">
                    <dd><a href="">邮件管理</a></dd>
                    <dd><a href="">消息管理</a></dd>
                    <dd><a href="">授权管理</a></dd>
                </dl>
            </li>
        </ul>
        <ul class="layui-nav layui-layout-right">
            <li class="layui-nav-item">
                <a href="javascript:;" data-href="/notice">通知<span class="layui-badge" id="notic-count">1</span></a>
            </li>
            <li class="layui-nav-item">
                <a href="javascript:;">
                    <img src="${Session.SPRING_SECURITY_CONTEXT.authentication.principal.meUser.imageUrl!'xxx'}" class="layui-nav-img">
                    ${Session.SPRING_SECURITY_CONTEXT.authentication.principal.meUser.name!'xxx'}
                </a>
                <dl class="layui-nav-child">
                    <dd><a href="">基本资料</a></dd>
                    <dd><a href="">安全设置</a></dd>
                </dl>
            </li>
            <li class="layui-nav-item"><a href="/logout">退了</a></li>
        </ul>
    </div>

    <div class="layui-side layui-bg-black">
        <div class="layui-side-scroll">
            <!-- 左侧导航区域（可配合layui已有的垂直导航） -->
            <ul class="layui-nav layui-nav-tree"  lay-filter="test">
                <li class="layui-nav-item layui-nav-itemed">
                    <a class="" href="javascript:;" data-href="/index">系统管理</a>
                    <dl class="layui-nav-child">
                        <@security.authorize access="hasAnyAuthority('admin','renshi')">
                             <dd><a href="javascript:;" data-href="/sysUser">用户管理</a></dd>
                        </@security.authorize>
                        <@security.authorize access="hasAnyAuthority('admin')">
                            <dd><a href="javascript:;" data-href="/sysRole">角色管理</a></dd>
                        </@security.authorize>
                        <@security.authorize access="hasAnyAuthority('admin')">
                             <dd><a href="javascript:;" data-href="/sysDept">部门管理</a></dd>
                        </@security.authorize>
                        <@security.authorize access="hasAnyAuthority('admin')">
                            <dd><a href="javascript:;" data-href="/sysDict">字典管理</a></dd>
                        </@security.authorize>
                        <@security.authorize access="hasAnyAuthority('admin')">
                             <dd><a href="javascript:;" data-href="/sysResources">菜单管理</a></dd>
                        </@security.authorize>
                        <@security.authorize access="hasAnyAuthority('admin')">
                            <dd><a href="javascript:;" data-href="/sysLog">业务日志</a></dd>
                        </@security.authorize>
                        <dd><a href="javascript:;" data-href="/sysNotice">通知管理</a></dd>

                    </dl>
                </li>
                <li class="layui-nav-item">
                    <a href="javascript:;">业务系统</a>
                    <dl class="layui-nav-child">
                        <!-- 普通员工 -->
                        <@security.authorize access="hasAnyAuthority('admin','ordinary')">
                             <dd><a href="javascript:;" data-href="/sysHouseInfo">房源录入</a></dd>
                         </@security.authorize>
                        <@security.authorize access="hasAnyAuthority('admin','ordinary')">
                                <dd><a href="javascript:;" data-href="/sysOwner">客户录入</a></dd>
                        </@security.authorize>
                        <@security.authorize access="hasAnyAuthority('admin','ordinary')">
                             <dd><a href="javascript:;" data-href="/sysAchievement">业绩信息</a></dd>
                        </@security.authorize>

                    </dl>
                </li>
                <li class="layui-nav-item">
                    <a href="javascript:;">考勤系统</a>
                    <dl class="layui-nav-child">
                            <!-- 普通员工 -->
                        <@security.authorize access="hasAnyAuthority('admin','ordinary')">
                            <dd><a href="javascript:;" data-href="/workApply">请假申请</a></dd>
                        </@security.authorize>
                        <@security.authorize access="hasAnyAuthority('admin','ordinary')">
                            <dd><a href="javascript:;" data-href="/sysRegister">打卡信息</a></dd>
                        </@security.authorize>

                    </dl>
                </li>
                <li class="layui-nav-item"><a href="">其他</a></li>
            </ul>
        </div>
    </div>

    <div class="layui-body">
        <!-- 内容主体区域 -->
        <div style="padding: 15px;" id="layui-content">
            <fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
                <legend>卡片面板</legend>
            </fieldset>

            <div style="padding: 20px; background-color: #F2F2F2;">
                <div class="layui-row layui-col-space15">
                    <div class="layui-col-md4">
                        <div class="layui-card">
                            <div class="layui-card-header">最近注册人数</div>
                            <div class="layui-card-body">
                                <div id="renshu" style="height: 200px;width: 100%"></div>
                            </div>
                        </div>
                    </div>
                    <div class="layui-col-md4">
                        <div class="layui-card">
                            <div class="layui-card-header">卡片面板</div>
                            <div class="layui-card-body">
                                卡片式面板面板通常用于非白色背景色的主体内<br>
                                从而映衬出边框投影
                            </div>
                        </div>
                    </div>
                    <div class="layui-col-md4">
                        <div class="layui-card">
                            <div class="layui-card-header">卡片面板</div>
                            <div class="layui-card-body">
                                结合 layui 的栅格系统<br>
                                轻松实现响应式布局
                            </div>
                        </div>
                    </div>
                    <div class="layui-col-md12">
                        <div class="layui-card">
                            <div class="layui-card-header">标题</div>
                            <div class="layui-card-body">
                                内容
                            </div>
                        </div>
                    </div>
                </div>
            </div>

        </div>
    </div>

    <div class="layui-footer">
        <!-- 底部固定区域 -->
        <button onclick="getyin()">考勤打卡</button>
        中介管理
    </div>
</div>
</body>
<script>
    function getyin() {
        /*var msg = new SpeechSynthesisUtterance("你好,what do you do？");
        // console.log(msg)
        //msg.rate = 4 播放语速
        //msg.pitch = 10 音调高低
        //msg.text = "播放文本"
        //msg.volume = 0.5 播放音量
        speechSynthesis.speak(msg);*/
        layui.use(['jquery','layer'],function () {
            var $=layui.jquery,
                layer=layui.layer;

            $.ajax({
                url:"/daka",
                success:function (html) {
                    openIndex= layer.open({
                        title:"打卡",
                        type:1,
                        area: ['600px', '600px'],
                        content:html
                    });
                }
            });

        })

    }
    //JavaScript代码区域
    layui.use(['element','jquery'], function(){
        var element = layui.element,
            $=layui.jquery;
        $("a").click(function () {
            var href=$(this).data("href");//得到当前a标签中data-href的值

            $("#layui-content").load(href);
        });

        /*$.ajax({
            url:'/notice/getNoticeByUser'
            ,dataType:'json'
            ,success:function (d) {
                $("#notic-count").html(d.data);
            }
        })*/
    });

</script>
</html>